package com.ddwanglife.lamda;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

import java.text.DecimalFormat;
import java.util.function.Function;

@AllArgsConstructor
@NoArgsConstructor
class MyMoney{
    private int money;
    public void printMoney(Function<Integer,String> formart){
        System.out.println(formart.apply(this.money));
    }
}
public class MoneyDemo {
    public static void main(String[] args) {
        MyMoney mm = new MyMoney(9999999);
        mm.printMoney(i-> new DecimalFormat("#,###").format(i));
    }
}
